﻿using Basic.HrRemoteModel.DicItem.Model;
using Basic.HrRemoteModel.TreeDic;
using Basic.HrRemoteModel.TreeDic.Model;
using Basic.HrService.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;

namespace Basic.HrService.RpcEvent
{
    internal class TreeItemEvent : IRpcApiService
    {
        private readonly ITreeDicItemService _Service;

        public TreeItemEvent ( ITreeDicItemService service )
        {
            this._Service = service;
        }
        public string[] FindTreeDicItemValue ( FindTreeDicItemValue obj )
        {
            return this._Service.FindValue(obj.Param);
        }
        public string GetTreeName ( GetTreeName obj )
        {
            return this._Service.GetTreeName(obj.DicId, obj.Value);
        }
        public bool EnableTreeDicItem ( EnableTreeDicItem obj )
        {
            return this._Service.Enable(obj.Id);
        }
        public TreeItemName[] BatchGetTreeName ( BatchGetTreeName obj )
        {
            return this._Service.GetTreeNames(obj.Param);
        }
        public Dictionary<string, string> GetTreeNameDic ( GetTreeNameDic obj )
        {
            return this._Service.GetTreeNameDic(obj.DicId, obj.Values);
        }
        public TreeItemName[] GetMoreTreeNames ( GetMoreTreeNames obj )
        {
            return this._Service.GetTreeNames(obj.DicId);
        }
        public string[] GetTreeNames ( GetTreeNames obj )
        {
            return this._Service.GetTreeNames(obj.DicId, obj.Values);
        }
        public bool StopTreeDicItem ( StopTreeDicItem obj )
        {
            return this._Service.Stop(obj.Id);
        }
        public long AddTreeDicItem ( AddTreeDicItem add )
        {
            return this._Service.Add(add.Datum);
        }

        public void DeleteTreeDicItem ( DeleteTreeDicItem obj )
        {
            this._Service.Delete(obj.Id);
        }
        public TreeFullItem[] GetFullDicTree ( GetFullDicTree obj )
        {
            return this._Service.GetFullTree(obj.Query);
        }
        public TreeDicItemDto GetTreeDicItem ( GetTreeDicItem obj )
        {
            return this._Service.Get(obj.Id);
        }
        public DicItem[] GetTreeItemList ( GetTreeItemList obj )
        {
            return this._Service.GetItems(obj.DicId, obj.IsEnd);
        }
        public TreeItemBase[] GetDicTree ( GetDicTree obj )
        {
            return this._Service.GetTrees(obj.DicId, obj.ParentVal);
        }

        public void MoveTreeDicItem ( MoveTreeDicItem obj )
        {
            this._Service.Move(obj.FromId, obj.ToId);
        }

        public PagingResult<TreeDicItemDto> QueryTreeDicItem ( QueryTreeDicItem obj )
        {
            return this._Service.Query(obj.Query, obj.ToBasicPage());
        }

        public bool SetTreeDicItem ( SetTreeDicItem set )
        {
            return this._Service.Set(set.Id, set.Datum);
        }
    }
}
